package com.cjyd.hrjb.controller.backend;

import com.cjyd.hrjb.controller.ApiGroup;
import com.cjyd.hrjb.controller.BaseController;
import com.cjyd.hrjb.model.dto.ResponseDto;
import com.cjyd.hrjb.model.dto.VerifyCodeDto;
import com.cjyd.hrjb.service.VerifyCodeService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


/**
 * Created fei wo by 2020/3/27
 */
@RestController
@RequestMapping(ApiGroup.BACKEND_V1)
public class VerifyCodeController extends BaseController {

    private VerifyCodeService verifyCodeService;

    public VerifyCodeController(VerifyCodeService verifyCodeService) {
        this.verifyCodeService = verifyCodeService;
    }

    @GetMapping("/verify")
    private ResponseDto<VerifyCodeDto> verifyCode(@RequestParam(value = "flag",required = false, defaultValue = "") String flag)  {
        return success(verifyCodeService.verifyPicBase64(flag));
    }

}
